#include"TimeStamp.h"

// #include "Timestamp.h"

// #include <time.h>

    TimeStamp::TimeStamp() : Time_(time(NULL)) {};
    TimeStamp::TimeStamp(const int64_t Time) : Time_(Time)
    {
    }
    std::string TimeStamp::toString()
    {
        char buf[128];
        tm *tm_ = localtime(&Time_);
        snprintf(buf, 128, "%4d-%02d-%02d %02d:%02d:%02d", tm_->tm_year + 1900, tm_->tm_mon + 1, tm_->tm_mday, tm_->tm_hour, tm_->tm_min, tm_->tm_sec);
        return buf;
    }
    TimeStamp TimeStamp::now()
    {
        return TimeStamp(time(NULL));
    }


